package com.wd.lobby;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.wd.config.Config;
import com.wd.nio.SessionMgr;

/**
 * @author long
 * @date 2013-5-4 上午10:13:56
 * @qq 108232706
 * @description LobbyServer
 */
public class LobbyServer {
	private static final Logger logger = LoggerFactory.getLogger(LobbyServer.class);
	private static final SessionMgr sessionMgr = new LobbySessionMgr(new LobbyIoHandler());

	public static void main(String[] args) {
		try {
			if (Config.initConfig("config/config.properties"))
				logger.info("config.properties初始化成功");
			else {
				logger.info("config.properties初始化失败");
				return;
			}
			 Runtime.getRuntime().addShutdownHook(new Thread() {

		            public void run() {
		               System.out.println("程序退出,释放资源");
		            }

		        });
			sessionMgr.start();
			
		} catch (Throwable e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
